package com.leshua.channel.mpos.service.lepos.impl;

import com.leshua.channel.mpos.mapper.lepos.MerchantTmpMapper;
import com.leshua.channel.mpos.model.lepos.MerchantTmp;
import com.leshua.channel.mpos.model.lepos.MerchantTmpExample;
import com.leshua.channel.mpos.service.lepos.MerchantTmpService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import javax.annotation.Resource;
import java.util.List;


@Service
public class MerchantTmpServiceImpl implements MerchantTmpService {

    @Resource
    private MerchantTmpMapper merchantTmpMapper;

    @Override
    public MerchantTmp queryMerchant(String merchantId) {
        MerchantTmpExample example = new MerchantTmpExample();
        MerchantTmpExample.Criteria criteria = example.createCriteria();
        criteria.andMerchantIdEqualTo(merchantId);
        List<MerchantTmp> merchantTmpList = merchantTmpMapper.selectByExample(example);
        return CollectionUtils.isEmpty(merchantTmpList) ? null : merchantTmpList.get(0);
    }
}
